Integrand size = 20, antiderivative size = 69 \[ \int \frac {1}{x \left (a+b+2 a x^2+a x^4\right )} \, dx=-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {a} \left (1+x^2\right )}{\sqrt {b}}\right )}{2 \sqrt {b} (a+b)}+\frac {\log (x)}{a+b}-\frac {\log \left (a+b+2 a x^2+a x^4\right )}{4 (a+b)} \]
ln(x)/(a+b)-1/4*ln(a*x^4+2*a*x^2+a+b)/(a+b)-1/2*arctan((x^2+1)*a^(1/2)/b^( 1/2))*a^(1/2)/(a+b)/b^(1/2)
Result contains complex when optimal does not.
Time = 0.04 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.52 \[ \int \frac {1}{x \left (a+b+2 a x^2+a x^4\right )} \, dx=\frac {4 \sqrt {b} \log (x)+i \left (\sqrt {a}+i \sqrt {b}\right ) \log \left (-i \sqrt {b}+\sqrt {a} \left (1+x^2\right )\right )+\left (-i \sqrt {a}-\sqrt {b}\right ) \log \left (i \sqrt {b}+\sqrt {a} \left (1+x^2\right )\right )}{4 \sqrt {b} (a+b)} \]
(4*Sqrt[b]*Log[x] + I*(Sqrt[a] + I*Sqrt[b])*Log[(-I)*Sqrt[b] + Sqrt[a]*(1 + x^2)] + ((-I)*Sqrt[a] - Sqrt[b])*Log[I*Sqrt[b] + Sqrt[a]*(1 + x^2)])/(4* Sqrt[b]*(a + b))
Time = 0.25 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.19, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.450, Rules used = {1434, 1144, 25, 27, 1142, 27, 1083, 217, 1103}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {1}{x \left (a x^4+2 a x^2+a+b\right )} \, dx\) |
\(\Big \downarrow \) 1434 |
\(\displaystyle \frac {1}{2} \int \frac {1}{x^2 \left (a x^4+2 a x^2+a+b\right )}dx^2\) |
\(\Big \downarrow \) 1144 |
\(\displaystyle \frac {1}{2} \left (\frac {\int -\frac {a \left (x^2+2\right )}{a x^4+2 a x^2+a+b}dx^2}{a+b}+\frac {\log \left (x^2\right )}{a+b}\right )\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{2} \left (\frac {\log \left (x^2\right )}{a+b}-\frac {\int \frac {a \left (x^2+2\right )}{a x^4+2 a x^2+a+b}dx^2}{a+b}\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{2} \left (\frac {\log \left (x^2\right )}{a+b}-\frac {a \int \frac {x^2+2}{a x^4+2 a x^2+a+b}dx^2}{a+b}\right )\) |
\(\Big \downarrow \) 1142 |
\(\displaystyle \frac {1}{2} \left (\frac {\log \left (x^2\right )}{a+b}-\frac {a \left (\int \frac {1}{a x^4+2 a x^2+a+b}dx^2+\frac {\int \frac {2 a \left (x^2+1\right )}{a x^4+2 a x^2+a+b}dx^2}{2 a}\right )}{a+b}\right )\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{2} \left (\frac {\log \left (x^2\right )}{a+b}-\frac {a \left (\int \frac {1}{a x^4+2 a x^2+a+b}dx^2+\int \frac {x^2+1}{a x^4+2 a x^2+a+b}dx^2\right )}{a+b}\right )\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {1}{2} \left (\frac {\log \left (x^2\right )}{a+b}-\frac {a \left (\int \frac {x^2+1}{a x^4+2 a x^2+a+b}dx^2-2 \int \frac {1}{-x^4-4 a b}d\left (2 a x^2+2 a\right )\right )}{a+b}\right )\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {1}{2} \left (\frac {\log \left (x^2\right )}{a+b}-\frac {a \left (\int \frac {x^2+1}{a x^4+2 a x^2+a+b}dx^2+\frac {\arctan \left (\frac {2 a x^2+2 a}{2 \sqrt {a} \sqrt {b}}\right )}{\sqrt {a} \sqrt {b}}\right )}{a+b}\right )\) |
\(\Big \downarrow \) 1103 |
\(\displaystyle \frac {1}{2} \left (\frac {\log \left (x^2\right )}{a+b}-\frac {a \left (\frac {\arctan \left (\frac {2 a x^2+2 a}{2 \sqrt {a} \sqrt {b}}\right )}{\sqrt {a} \sqrt {b}}+\frac {\log \left (a x^4+2 a x^2+a+b\right )}{2 a}\right )}{a+b}\right )\) |
(Log[x^2]/(a + b) - (a*(ArcTan[(2*a + 2*a*x^2)/(2*Sqrt[a]*Sqrt[b])]/(Sqrt[ a]*Sqrt[b]) + Log[a + b + 2*a*x^2 + a*x^4]/(2*a)))/(a + b))/2
3.10.9.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( -1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & & (LtQ[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S imp[(2*c*d - b*e)/(2*c) Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
Int[1/(((d_.) + (e_.)*(x_))*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)), x_Symbol] :> Simp[e*(Log[RemoveContent[d + e*x, x]]/(c*d^2 - b*d*e + a*e^2)), x] + S imp[1/(c*d^2 - b*d*e + a*e^2) Int[(c*d - b*e - c*e*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
Int[(x_)^(m_)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> Simp [1/2 Subst[Int[x^((m - 1)/2)*(a + b*x + c*x^2)^p, x], x, x^2], x] /; Free Q[{a, b, c, p}, x] && IntegerQ[(m - 1)/2]
Result contains higher order function than in optimal. Order 9 vs. order 3.
Time = 0.05 (sec) , antiderivative size = 62, normalized size of antiderivative = 0.90
method | result | size |
risch | \(\frac {\ln \left (x \right )}{a +b}+\frac {\left (\munderset {\textit {\_R} =\operatorname {RootOf}\left (1+\left (a b +b^{2}\right ) \textit {\_Z}^{2}+2 b \textit {\_Z} \right )}{\sum }\textit {\_R} \ln \left (\left (\left (-a +5 b \right ) \textit {\_R} +5\right ) x^{2}+\left (-a -b \right ) \textit {\_R} +4\right )\right )}{4}\) | \(62\) |
default | \(\frac {\ln \left (x \right )}{a +b}-\frac {a \left (\frac {\ln \left (a \,x^{4}+2 a \,x^{2}+a +b \right )}{2 a}+\frac {\arctan \left (\frac {2 a \,x^{2}+2 a}{2 \sqrt {a b}}\right )}{\sqrt {a b}}\right )}{2 \left (a +b \right )}\) | \(63\) |
ln(x)/(a+b)+1/4*sum(_R*ln(((-a+5*b)*_R+5)*x^2+(-a-b)*_R+4),_R=RootOf(1+(a* b+b^2)*_Z^2+2*b*_Z))
Time = 0.26 (sec) , antiderivative size = 147, normalized size of antiderivative = 2.13 \[ \int \frac {1}{x \left (a+b+2 a x^2+a x^4\right )} \, dx=\left [\frac {\sqrt {-\frac {a}{b}} \log \left (\frac {a x^{4} + 2 \, a x^{2} - 2 \, {\left (b x^{2} + b\right )} \sqrt {-\frac {a}{b}} + a - b}{a x^{4} + 2 \, a x^{2} + a + b}\right ) - \log \left (a x^{4} + 2 \, a x^{2} + a + b\right ) + 4 \, \log \left (x\right )}{4 \, {\left (a + b\right )}}, \frac {2 \, \sqrt {\frac {a}{b}} \arctan \left (\frac {b \sqrt {\frac {a}{b}}}{a x^{2} + a}\right ) - \log \left (a x^{4} + 2 \, a x^{2} + a + b\right ) + 4 \, \log \left (x\right )}{4 \, {\left (a + b\right )}}\right ] \]
[1/4*(sqrt(-a/b)*log((a*x^4 + 2*a*x^2 - 2*(b*x^2 + b)*sqrt(-a/b) + a - b)/ (a*x^4 + 2*a*x^2 + a + b)) - log(a*x^4 + 2*a*x^2 + a + b) + 4*log(x))/(a + b), 1/4*(2*sqrt(a/b)*arctan(b*sqrt(a/b)/(a*x^2 + a)) - log(a*x^4 + 2*a*x^ 2 + a + b) + 4*log(x))/(a + b)]
Leaf count of result is larger than twice the leaf count of optimal. 194 vs. \(2 (61) = 122\).
Time = 2.31 (sec) , antiderivative size = 194, normalized size of antiderivative = 2.81 \[ \int \frac {1}{x \left (a+b+2 a x^2+a x^4\right )} \, dx=\left (- \frac {1}{4 \left (a + b\right )} - \frac {\sqrt {- a b}}{4 b \left (a + b\right )}\right ) \log {\left (x^{2} + \frac {- 4 a b \left (- \frac {1}{4 \left (a + b\right )} - \frac {\sqrt {- a b}}{4 b \left (a + b\right )}\right ) + a - 4 b^{2} \left (- \frac {1}{4 \left (a + b\right )} - \frac {\sqrt {- a b}}{4 b \left (a + b\right )}\right ) - b}{a} \right )} + \left (- \frac {1}{4 \left (a + b\right )} + \frac {\sqrt {- a b}}{4 b \left (a + b\right )}\right ) \log {\left (x^{2} + \frac {- 4 a b \left (- \frac {1}{4 \left (a + b\right )} + \frac {\sqrt {- a b}}{4 b \left (a + b\right )}\right ) + a - 4 b^{2} \left (- \frac {1}{4 \left (a + b\right )} + \frac {\sqrt {- a b}}{4 b \left (a + b\right )}\right ) - b}{a} \right )} + \frac {\log {\left (x \right )}}{a + b} \]
(-1/(4*(a + b)) - sqrt(-a*b)/(4*b*(a + b)))*log(x**2 + (-4*a*b*(-1/(4*(a + b)) - sqrt(-a*b)/(4*b*(a + b))) + a - 4*b**2*(-1/(4*(a + b)) - sqrt(-a*b) /(4*b*(a + b))) - b)/a) + (-1/(4*(a + b)) + sqrt(-a*b)/(4*b*(a + b)))*log( x**2 + (-4*a*b*(-1/(4*(a + b)) + sqrt(-a*b)/(4*b*(a + b))) + a - 4*b**2*(- 1/(4*(a + b)) + sqrt(-a*b)/(4*b*(a + b))) - b)/a) + log(x)/(a + b)
Time = 0.27 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.88 \[ \int \frac {1}{x \left (a+b+2 a x^2+a x^4\right )} \, dx=-\frac {a \arctan \left (\frac {a x^{2} + a}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (a x^{4} + 2 \, a x^{2} + a + b\right )}{4 \, {\left (a + b\right )}} + \frac {\log \left (x^{2}\right )}{2 \, {\left (a + b\right )}} \]
-1/2*a*arctan((a*x^2 + a)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - 1/4*log(a*x^4 + 2*a*x^2 + a + b)/(a + b) + 1/2*log(x^2)/(a + b)
Time = 0.31 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.88 \[ \int \frac {1}{x \left (a+b+2 a x^2+a x^4\right )} \, dx=-\frac {a \arctan \left (\frac {a x^{2} + a}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (a x^{4} + 2 \, a x^{2} + a + b\right )}{4 \, {\left (a + b\right )}} + \frac {\log \left (x^{2}\right )}{2 \, {\left (a + b\right )}} \]
-1/2*a*arctan((a*x^2 + a)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - 1/4*log(a*x^4 + 2*a*x^2 + a + b)/(a + b) + 1/2*log(x^2)/(a + b)
Time = 13.28 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.03 \[ \int \frac {1}{x \left (a+b+2 a x^2+a x^4\right )} \, dx=\frac {\ln \left (x\right )}{a+b}-\frac {4\,b\,\ln \left (a\,x^4+2\,a\,x^2+a+b\right )}{16\,b^2+16\,a\,b}-\frac {\sqrt {a}\,\mathrm {atan}\left (\frac {\sqrt {a}}{\sqrt {b}}+\frac {\sqrt {a}\,x^2}{\sqrt {b}}\right )}{2\,\sqrt {b}\,\left (a+b\right )} \]